package ee520;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import java.util.List;

public class JieXi {
    public static void main(String[] args) throws DocumentException {
        SAXReader reader = new SAXReader();
        Document document= reader.read(JieXi.class.getResourceAsStream("src/main/dom4j.xml"));
        Element rootElement = document.getRootElement();
        List<Element> elements = rootElement.elements();
        for (Element element : elements) {
            String name = element.getName();
            String text = element.getText();
            System.out.println(name+":"+text);
        }
    }
}
